<?php
// Only works on POSIX/Unix/Linux/BSD/other shit >.>

////////////////////////////////////////////////////
//// WARNINGS AND STUFF HERE ..... ><<<<<<<<   ////
//////////////////////////////////////////////////
/* This is *VERY* Expermental...  
it only works on *nix, and it doesnt not work on all 
default php.ini configurations... You have been warned.

KNOWN TO WORK ON:
Debian Etch - Default php 5.2.6
ArchLinux - you have to enable posix.so in php.ini >.>
*/

set_time_limit(0); //should be in ruffy but just to make sure.
if(pcntl_fork()){
	$mypid = getmypid();
	$myrealpid = $mypid + 2;
	echo "<ruffy> Ohai..  I live as a daemon \o/\n";
	echo "*** ruffy 's PID (uncase you need to kill it) , is: $myrealpid\n";
	echo "Enjoy.\n";
	exit;
} else {
	posix_setsid();
	`php ruffy.php`;
}
?>
